#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
  int minimumBoxes(vector<int> &apple, vector<int> &capacity)
  {
    int sum = 0;
    for (int ap : apple)
      sum += ap;
    sort(capacity.begin(), capacity.end());
    int n = capacity.size();
    int i = n - 1;
    while (sum > 0)
    {
      sum -= capacity[i--];
    }
    return n - i - 1;
  }
};
int main()
{
  Solution s;

  return 0;
}
